package demo.treemap;

import java.util.*;

/**
 * Version: 1.1
 * Author: TangJun
 * Date: 2024-07-23
 */
public class Main {
    public static void main(String[] args) {
        TreeMap map = new TreeMap(new Comparator() {
            @Override
            public int compare(Object o1, Object o2) {
                return ((String)o1).compareTo((String)o2);
            }
        });
        //TreeMap map = new TreeMap();
        map.put(null, "null");
        map.put("afwaf", "");
        map.put("cawf", "");
        map.put("afwaf", "");

        Set set = map.keySet();
        for (Object o : set) {
            String key = (String)o;
            System.out.println(key);
        }
    }
}
